package com.xinchao.dao;

import com.github.pagehelper.Page;
import com.xinchao.model.Advertiser;
import com.xinchao.model.dto.AdvertiserListDTO;
import com.xinchao.model.dto.AdvertiserSelectDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author dxy
 * @date 2018/9/18 17:09
 */
public interface AdvertiserMapper {
	/**
	 * 保存广告主
	 *
	 * @param advertiser Advertiser
	 */
	void insertAdvertiser(Advertiser advertiser);

	/**
	 * 更新广告主
	 *
	 * @param advertiser Advertiser
	 */
	void updateAdvertiserById(Advertiser advertiser);

	/**
	 * 通过ID获取广告主
	 * @param advertiserId 广告主ID
	 * @return Advertiser
	 */
	Advertiser getAdvertiserById(Long advertiserId);

	/**
	 * 获取广告主列表
	 *
	 * @param advertiserName 广告主名称
	 * @return Page<AdvertiserListDTO>
	 */
	Page<AdvertiserListDTO> listAdvertiser(@Param("advertiserName") String advertiserName);

	/**
	 * 获取广告选择列表
	 * @return List<AdvertiserSelectDTO>
	 */
	List<AdvertiserSelectDTO> listAdvertiserSelect();

	/**
	 * 通过账号获取广告主
	 *
	 * @param userName 账号
	 * @return Advertiser
	 */
	Advertiser getAdvertiserByUserName(String userName);
}
